package com.dk.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dk.pojo.TCar;
import com.dk.mapper.TCarMapper;
import com.dk.service.ITCarService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author author
 * @since 2021-10-29
 */
@Service
public class TCarServiceImpl extends ServiceImpl<TCarMapper, TCar> implements ITCarService {

    @Autowired
    private TCarMapper tCarMapper;

    //车辆审核
    @Override
    public int updateStatus(TCar tCar, Integer status,String sellerId) {
        Integer i = 0;
        if(status == 1){
            tCar.setStatus(1);
            tCar.setSellerId(sellerId);
            i = tCarMapper.updateById(tCar);
        }else {
            tCar.setStatus(2);
            tCar.setSellerId(sellerId);
            i = tCarMapper.updateById(tCar);
        }
        return i;
    }

//    @Override
//    public Integer updateByidDe(TCar tCar, QueryWrapper wrapper) {
//        int i = tCarMapper.update(tCar, wrapper);
//        return i;
//    }

}
